package com.yuantong.xyerp.core.api.service;

import com.yuantong.xyerp.core.api.dto.UserDto;
import com.yuantong.xyerp.core.api.model.User;
import com.yuantong.xyerp.core.api.model.UserDetail;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by Jianguo.Yin on 2021-07-09.
 */
public interface IUserService {

    UserDetail selectOneByUserDetail(UserDetail userDetail);

    List<UserDto> findByFuzzy(String roleId, String organizationId, String fuzzy, List<UserDto> userDtos);

    /**
     * 根据 userDto 的 organizationId 获得该部门下所有员工 id
     */
    List<String> getIdByOrganizationId(UserDto userDto);

    /**
     * 根据 userDto 的 organizationId 获得该部门下所有员工 loginName
     */
    List<String> getLoginNameByOrganizationId(UserDto userDto);

    /**
     * 根据 userDto 的 roleId 获得该角色下所有员工 id
     */
    List<String> getLoginNameByRoleId(UserDto userDto);

    int saveBatchByUserDtos(List<UserDto> userDtos);

    /**
     * 为清除 userDetail 缓存而建立的空方法
     */
    void userDetailCacheDelete();

    int update(User user);
}
